package com.travelparadise.tests;

import junit.framework.TestCase;

import org.springframework.context.ApplicationContext;

import com.travelparadise.dao.ClientDao;
import com.travelparadise.domain.Client;

public class TestClientDao extends TestCase {
	private ClientDao clientDao = null;

	@Override
	protected void setUp() throws Exception {
		ApplicationContext springContext = SpringContextForTest.getSpringContext();
		this.clientDao = (ClientDao ) springContext.getBean("clientDaoHibernate");
	}
	
	public void testupdateClient(){
		Client client = clientDao.getById(4);
		client.setPrenom("Zizou");
		clientDao.updateClient(client);
	}
	
	public void testGetById(){
		Client client = clientDao.getById(4);
		System.out.println(client.getTitre()+" "+client.getPrenom()+
							" "+client.getNom()+"\n\t"+client.getEmail());
		System.out.println("Paiement : "+client.getInfoPaiement());
		System.out.println("********************************************");
		assertTrue(client.getId()==4);
	}


}
